package com.example.leetdemo.finash;

import java.sql.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Solution1175 {

    public static int numPrimeArrangements(int n) {
        Integer[] pri = new Integer[] {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
        Set<Integer> set = new HashSet<>(Arrays.asList(pri));
        int a = 0; int b = 0;
        long count1 = 1;
        for (int i = 1; i <= n; i++) {
            if (set.contains(i)) {
                a++;
            } else {
                b++;
            }
        }
        for (int i = 2; i <= a; i++) {
            count1 = (count1 * i) % (1000000000 + 7);
        }
        for (int i = 2; i <= b; i++) {
            count1 = (count1 * i) % (1000000000 + 7);
        }
        return (int) count1;
    }

    public static void main(String[] args) {
        int[] pri = new int[] {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
        System.err.println(numPrimeArrangements(100));
    }

}
